package memento.white_box;

/**
 * @Author: Doream
 * @Date: 2022/1/30 18:02
 */
public class Client {
    public static void main(String[] args) {
        System.out.println("----------------大战Boss前--------------------");
        GameRole gameRole = new GameRole();
        gameRole.initState();
        gameRole.stateDisplay();
        RoleStateCaretaker roleStateCaretaker = new RoleStateCaretaker();
        roleStateCaretaker.setRoleStateMemento(gameRole.saveState());
        gameRole.fight();
        System.out.println("----------------大战Boss后--------------------");
        gameRole.stateDisplay();
        System.out.println("----------------不满意复原历史状态--------------------");
        gameRole.recoverState(roleStateCaretaker.getRoleStateMemento());
        gameRole.stateDisplay();
    }
}
